export const setStorage = (key, value) => {
  value = typeof value === 'string' ? value : JSON.stringify(value)
  return localStorage.setItem(key, value)
}

export const getStorage = key => {
  let value = localStorage.getItem(key)
  value = typeof value === 'string' ? JSON.parse(value) : value
  return value
}

export const removeStorage = key => localStorage.removeItem(key)

export const clearStorage = () => localStorage.clear()
